package it.fuzzylogics.fuzzywidgetsLibrary.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Label;
import it.fuzzylogics.fuzzywidgetsLibrary.client.FuzzyImageBox.FImageBox;
import it.fuzzylogics.fuzzywidgetsLibrary.client.FuzzyTabPanel.FTabPanel;
import it.fuzzylogics.fuzzywidgetsLibrary.client.FuzzyTabPanel.TabPanelListener;


public class Fuzzywidgets implements EntryPoint {

    //  FResizableCellPanel cellPanel=new FResizableCellPanel(1,1);
    public void onModuleLoad() {

        /*FClickListener.setClickEvent(d.getElement(), new FClickListenerHandler() {

            public void onClick() {
                Window.alert("clicked");
            }
        });*/

        /*FMouseEnterListener.setMouseEnterEvent(d.getElement(), new FMouseEnterHandler()
        {

            public void onMouseEnter() {
                Window.alert("onMouseEnter");
            }
        });*/

        /*FMouseLeaveListener.setMouseLeaveEvent(d.getElement(), new FMouseLeaveHandler()
        {

            public void onMouseLeave() {
                Window.alert("onMouseLeave");
            }
        });*/

        /*FMouseDownListener.setMouseDownEvent(d.getElement(), new FMouseDownHandler()
        {

            public void onMouseDown() {
                Window.alert("onMouseDown");
            }
        });*/

        /*FMouseUpListener.setMouseUpEvent(d.getElement(), new FMouseUpHandler()
        {

            public void onMouseUp() {
                Window.alert("onMouseUpn");
            }
        });*/

        /*FMouseMoveListener.setMouseMoveEvent(d.getElement(), new FMouseMoveHandler()
        {

            public void onMouseMove(int x , int y) {
                Window.alert("onMouseMove "+x +" "+y);
            }
        });*/

        /*FMouseWheelListener.setMouseWheelListener(d.getElement(), new FMouseWheelHandler()
        {
            public void onMouseWheelUp(int intensity) {
                Window.alert(-intensity+"");
            }

            public void onMouseWheelDown(int intensity) {
                Window.alert(intensity+"");
            }
        });*/

        /*Image test = new Image("albero_con_il_pene.jpg");
       test.setPixelSize(650, 687);

       FScrollPanel demo = new FScrollPanel(test);
       demo.setVerticalBarWidth(19);
       demo.setHorizontalBarHeight(19);
       demo.setVerticalUpArrowImageUrl("fuzzyWidgetsImages/scrollpanel/up.png");
       demo.setVerticalDownArrowImageUrl("fuzzyWidgetsImages/scrollpanel/down.png");
       demo.setPixelSize(400, 400);
        */
        //   DOM.setStyleAttribute(RootPanel.get().getElement(), "background", "black");

        //  RootPanel.get().add(demo,200,50);

        /*
   Label testLabel=new Label("ciao1");
       Label testLabel2=new Label("ciao2");

       testLabel.setStyleName("testLabel");
       testLabel2.setStyleName("testLabel");

       AbsolutePanel testcontent=new AbsolutePanel();

       testcontent.setStyleName("testcontent");

       AbsolutePanel testcontent1=new AbsolutePanel();

       testcontent1.setStyleName("testcontent");

       FStackPanel stackPanel  = new  FStackPanel();

       stackPanel.setStyleName("FStackPanel");

       stackPanel.addItem(testLabel,testcontent);



        stackPanel.addItem(new Label("ciao"),new AbsolutePanel());
       stackPanel.addItem(new Label("ciao"),new AbsolutePanel());
       stackPanel.addItem(new Label("ciao"),new AbsolutePanel());
       stackPanel.addItem(new Label("ciao"),new AbsolutePanel());

       stackPanel.setPixelSize(200,400);

        stackPanel.setHeaderHeight(30);

       stackPanel.removeItem(3);




         stackPanel.addItem(testLabel2,testcontent1);

         stackPanel.openItem(2);

        RootPanel.get().add(stackPanel,200,50);




        */
        /* final FVerticalTable vtable = new  FVerticalTable();


     AbsolutePanel testcontent=new AbsolutePanel();

             testcontent.setStyleName("testcontent");

             AbsolutePanel testcontent1=new AbsolutePanel();

             testcontent1.setStyleName("testcontent");

     vtable.setHeaders(new Widget[] {new Label("ciao1"),new Label("ciao2"),new Label("ciao3"),new Label("ciao4"),new Label("ciao5")});


       for(int i=0;i<40;i++)
       {
           AbsolutePanel panel = new AbsolutePanel();
           panel.setStyleName("testcontent");
           Label l = new Label(""+i);
           panel.add(l,0,0);
           vtable.addItem(new Widget[] {new Label(""+i),new Label(""+i),new Label(""+i),new Label(""+i),new Label(""+i)});
       }


      vtable.addVerticalTableListener(new VerticalTableListener()
      {

          public void onClick(int index)
          {
                 vtable.selectItem(index+1);
          }
      });
     cellPanel.insertAt(vtable,0,0,1,1);
      RootPanel.get().add(cellPanel,200,50);
     cellPanel.setPixelSize(200,400);





   RootPanel.get().add(cellPanel,10,10);

        */


         /*inal FImageBox fImageBox = new FImageBox();
         fImageBox.setUrl("fuzzyWidgetsImages/tab.png");
         fImageBox.setPixelSize(10,10);
         RootPanel.get().add(fImageBox,10,10);*/
        

        //  fImageBox.setVisible(false);

        //fImageBox.setPixelSize(200,200);
        /*   fImageBox.setPixelSize(200,200);
        fImageBox.setPixelSize(200,200);
        fImageBox.setPixelSize(200,200);
        */
        // fImageBox.setUrl("fuzzyWidgetsImages/sfera.png");
        // fImageBox.setPixelSize(200,200);

        FTabPanel tabPanel = new  FTabPanel();
        tabPanel.addTab(new Label("ciao"),new Label("ciao"));
         tabPanel.setPixelSize(400,300);
        tabPanel.addTabPanelListener(new TabPanelListener()
        {

            public void onTabOpened(int tabIndex) {
                System.out.println(tabIndex);
            }
        });
        RootPanel.get().add(tabPanel,10,10);

    }


}
